{{extend 'layout.html'}}
<h1>Defect Type Standard Report</h1>

<table>
    <tr>
        <th>No.</th>
        <th>Name</th>
        <th width="45%">Description</th>
        <th>Quantity</th>
        <th>Freq. %</th>
        <th>Fix Time</th>
        <th>Time %</th>
        <th>Average</th>
    </tr>
    
    {{for defect_type, defect_name in sorted(PSP_DEFECT_TYPES.items()):}}
    <tr>
        <td>{{=defect_type}}</td>
        <td>{{=defect_name}}</td>
        <td>{{=PSP_DEFECT_DESC[defect_type]}}</td>
        <td style="text-align: right;">{{='%d' % (defect_count_per_type.get(defect_type, 0))}}</td>
        <td style="text-align: right;">{{='%.2f' % (defect_count_per_type.get(defect_type, 0)/float(defect_count)*100.0)}} %</td>
        <td style="text-align: right;">{{=pretty_time(defect_fix_time_per_type.get(defect_type, 0))}} </td>
        <td style="text-align: right;">{{='%.2f' % (defect_fix_time_per_type.get(defect_type, 0) / float(total_fix_time) * 100.)}} %    </td>
        <td style="text-align: right;">{{=defect_count_per_type.get(defect_type, 0) and pretty_time(defect_fix_time_per_type.get(defect_type, 0) / float(defect_count_per_type.get(defect_type, 0))) or ''}}    </td>
    </tr>
    {{pass}}
</table>
